<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="scripts/jquery-1.5.2.min.js"></script>
        <script type="text/javascript">
            ;(function($){
                $.fn.extend({
                    "color" : function(value) {
                        return this.css("color", value);
                    },
                    "border" : function(options) {
                        options = $.extend({
                            width:"1px",
                            color:"black",
                            style:"solid"
                        }, options);
                        this.css("borderWidth", options.width);
                        this.css("borderColor", options.color);
                        this.css("borderStyle", options.style);
                    }
                });
                $.extend({
                    //去除左边空格
                    "ltrim" : function(text) {
                        return (text || "").replace(/^\s+/g,"")
                    },
                    //去除右边空格
                    "rtrim" : function(text) {
                        return (text || "").replace(/\s+$/g,"")
                    }
                });
            })(jQuery);
            $(function(){
                $("div").color("red");
                $("#div1").border({color:'blue',width:"5px"});
                alert("b"+ $.ltrim(" aaaaa"));
            })
        </script>
    </head>
    <body>
        <div>TODO write content</div>
        <div>TODO write content</div>
        <div id="div1">Haha</div>
    </body>
</html>
